/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * frmPemesananKeSupplier.java
 *
 * Created on Jan 25, 2012, 10:56:06 AM
 */
package SIMRS.Apotek.view;

import SIMRS.Apotek.sql.KoneksiDatabase;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import usu.widget.Form;
import java.util.Calendar;
import java.util.Date;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import javax.swing.JOptionPane;
import javax.swing.table.DefaultTableModel;
import SIMRS.Apotek.view.frmInformasiPemesananBarangKeSupplier;

/**
 *
 * @author yunniie
 */
public class frmPemesananKeSupplier extends Form {
private static DefaultTableModel model;
Connection koneksi=KoneksiDatabase.getKoneksi();
    /** Creates new form frmPemesananKeSupplier */
    public frmPemesananKeSupplier() {
        initComponents();
        
         model=new DefaultTableModel();
        tblPemesananSupplier.setModel(model);
        model.addColumn("Kode Barang");
        model.addColumn("Nama Barang");
        model.addColumn("Jumlah");
        
        
        
        Date tanggal = new Date();
        txtTanggalOrder.setDate(tanggal);
        
         cmbNamaBarang.addItem("");
        try{
         Statement stm = koneksi.createStatement();
         ResultSet rs = stm.executeQuery("select * from obat order by NamaBarang asc");
         rs.beforeFirst();
         while(rs.next()){
             cmbNamaBarang.addItem(rs.getString("NamaBarang"));
         }
         rs.close();
     }
     catch(SQLException ex)
     {
         System.out.println("Error : "+ex);
         }

        
        cmbRuangan.addItem("");
        try{
         Statement stm = koneksi.createStatement();
         ResultSet rs = stm.executeQuery("select * from ruangan order by NamaRuangan asc");
         rs.beforeFirst();
         while(rs.next()){
             cmbRuangan.addItem(rs.getString("NamaRuangan"));
         }
         rs.close();
     }
     catch(SQLException ex)
     {
         System.out.println("Error : "+ex);
         }

        
        cmbRuanganTujuan.addItem("");
        try{
         Statement stm = koneksi.createStatement();
         ResultSet rs = stm.executeQuery("select * from ruangan order by NamaRuangan asc");
         rs.beforeFirst();
         while(rs.next()){
             cmbRuanganTujuan.addItem(rs.getString("NamaRuangan"));
         }
         rs.close();
     }
     catch(SQLException ex)
     {
         System.out.println("Error : "+ex);
         }
        
        
        cmbNamaSupplier.addItem("");
        try{
         Statement stm = koneksi.createStatement();
         ResultSet rs = stm.executeQuery("select * from supplier order by NamaSupplier asc");
         rs.beforeFirst();
         while(rs.next()){
             cmbNamaSupplier.addItem(rs.getString("NamaSupplier"));
         }
         rs.close();
     }
     catch(SQLException ex)
     {
         System.out.println("Error : "+ex);
         }
        
         cmbUser.addItem("");
        try{
         Statement stm = koneksi.createStatement();
         ResultSet rs = stm.executeQuery("select * from pegawai order by Nama asc");
         rs.beforeFirst();
         while(rs.next()){
             cmbUser.addItem(rs.getString("Nama"));
         }
         rs.close();
     }
     catch(SQLException ex)
     {
         System.out.println("Error : "+ex);
         }
        
        setIconImage(new javax.swing.ImageIcon(getClass().getResource("/SIMRS/Apotek/gambar/icon.png")).getImage());
        setTitle(".:: Form Pemesanan Ke Supplier");
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        pnlForm1 = new SIMRS.Apotek.widget.PnlForm();
        btnSimpan = new SIMRS.Apotek.widget.button2();
        btnBatal = new SIMRS.Apotek.widget.button2();
        btnTutup = new SIMRS.Apotek.widget.button2();
        label1 = new SIMRS.Apotek.widget.Label();
        label3 = new SIMRS.Apotek.widget.Label();
        txtJumlah = new SIMRS.Apotek.widget.TextBox();
        label5 = new SIMRS.Apotek.widget.Label();
        cmbNamaSupplier = new javax.swing.JComboBox();
        label6 = new SIMRS.Apotek.widget.Label();
        scrollPane1 = new SIMRS.Apotek.widget.ScrollPane();
        tblPemesananSupplier = new SIMRS.Apotek.widget.Table();
        btnTambah = new SIMRS.Apotek.widget.button2();
        btnHapus = new SIMRS.Apotek.widget.button2();
        label13 = new SIMRS.Apotek.widget.Label();
        txtTanggalOrder = new com.toedter.calendar.JDateChooser();
        txtTotal = new SIMRS.Apotek.widget.TextBox();
        label8 = new SIMRS.Apotek.widget.Label();
        label2 = new SIMRS.Apotek.widget.Label();
        txtNoOrder = new SIMRS.Apotek.widget.TextBox();
        label4 = new SIMRS.Apotek.widget.Label();
        label7 = new SIMRS.Apotek.widget.Label();
        cmbRuanganTujuan = new javax.swing.JComboBox();
        cmbRuangan = new javax.swing.JComboBox();
        ruanganTujuan = new javax.swing.JTextField();
        ruangan = new javax.swing.JTextField();
        kdBarang = new javax.swing.JTextField();
        kdSupplier = new javax.swing.JTextField();
        cmbNamaBarang = new javax.swing.JComboBox();
        label9 = new SIMRS.Apotek.widget.Label();
        cmbUser = new javax.swing.JComboBox();
        kdUser = new javax.swing.JTextField();

        setTitle("Form Pemesanan Ke Supplier");
        setAnimationHide(usu.widget.constan.Animation.SHOW_FROM_BOTTOM);
        setAnimationShow(usu.widget.constan.Animation.SHOW_FROM_TOP);
        setUndecorated(true);
        addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowClosing(java.awt.event.WindowEvent evt) {
                formWindowClosing(evt);
            }
        });
        getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        pnlForm1.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(57, 190, 53), 3, true));
        pnlForm1.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        btnSimpan.setIcon(new javax.swing.ImageIcon(getClass().getResource("/SIMRS/Apotek/gambar/bt_simpan.png"))); // NOI18N
        btnSimpan.setText("Simpan");
        btnSimpan.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnSimpanActionPerformed(evt);
            }
        });
        pnlForm1.add(btnSimpan, new org.netbeans.lib.awtextra.AbsoluteConstraints(340, 460, -1, -1));

        btnBatal.setIcon(new javax.swing.ImageIcon(getClass().getResource("/SIMRS/Apotek/gambar/bt_batal.png"))); // NOI18N
        btnBatal.setText("Batal");
        pnlForm1.add(btnBatal, new org.netbeans.lib.awtextra.AbsoluteConstraints(460, 460, -1, -1));

        btnTutup.setIcon(new javax.swing.ImageIcon(getClass().getResource("/SIMRS/Apotek/gambar/bt_close.png"))); // NOI18N
        btnTutup.setText("Tutup");
        btnTutup.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnTutupActionPerformed(evt);
            }
        });
        pnlForm1.add(btnTutup, new org.netbeans.lib.awtextra.AbsoluteConstraints(630, 460, -1, -1));

        label1.setText("Nama Barang");
        pnlForm1.add(label1, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 170, 110, 20));

        label3.setText("Jumlah");
        pnlForm1.add(label3, new org.netbeans.lib.awtextra.AbsoluteConstraints(190, 170, 60, 20));

        txtJumlah.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtJumlahActionPerformed(evt);
            }
        });
        pnlForm1.add(txtJumlah, new org.netbeans.lib.awtextra.AbsoluteConstraints(180, 190, 80, -1));

        label5.setText("Nama Supplier");
        pnlForm1.add(label5, new org.netbeans.lib.awtextra.AbsoluteConstraints(280, 170, 100, 20));

        cmbNamaSupplier.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cmbNamaSupplierActionPerformed(evt);
            }
        });
        pnlForm1.add(cmbNamaSupplier, new org.netbeans.lib.awtextra.AbsoluteConstraints(270, 190, 170, -1));

        label6.setText("Tanggal Order");
        pnlForm1.add(label6, new org.netbeans.lib.awtextra.AbsoluteConstraints(490, 170, 90, 20));

        tblPemesananSupplier.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
            }
        ));
        scrollPane1.setViewportView(tblPemesananSupplier);

        pnlForm1.add(scrollPane1, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 230, 700, 180));

        btnTambah.setIcon(new javax.swing.ImageIcon(getClass().getResource("/SIMRS/Apotek/gambar/bt_tambah.png"))); // NOI18N
        btnTambah.setText("Tambah");
        btnTambah.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnTambahActionPerformed(evt);
            }
        });
        pnlForm1.add(btnTambah, new org.netbeans.lib.awtextra.AbsoluteConstraints(647, 180, 110, -1));

        btnHapus.setIcon(new javax.swing.ImageIcon(getClass().getResource("/SIMRS/Apotek/gambar/bt_hapus.png"))); // NOI18N
        btnHapus.setText("Hapus");
        btnHapus.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnHapusActionPerformed(evt);
            }
        });
        pnlForm1.add(btnHapus, new org.netbeans.lib.awtextra.AbsoluteConstraints(767, 180, -1, -1));

        label13.setForeground(new java.awt.Color(255, 255, 255));
        label13.setText("Pemesanan Ke Supplier");
        label13.setFont(new java.awt.Font("Tahoma", 1, 18));
        pnlForm1.add(label13, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 40, 400, -1));
        pnlForm1.add(txtTanggalOrder, new org.netbeans.lib.awtextra.AbsoluteConstraints(490, 190, 150, -1));
        pnlForm1.add(txtTotal, new org.netbeans.lib.awtextra.AbsoluteConstraints(600, 420, 120, -1));

        label8.setText("Total");
        pnlForm1.add(label8, new org.netbeans.lib.awtextra.AbsoluteConstraints(560, 420, 30, 20));

        label2.setText("No Order");
        pnlForm1.add(label2, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 114, -1, -1));
        pnlForm1.add(txtNoOrder, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 130, 80, -1));

        label4.setText("Ruangan Tujuan");
        pnlForm1.add(label4, new org.netbeans.lib.awtextra.AbsoluteConstraints(360, 110, -1, 20));

        label7.setText("Ruangan");
        pnlForm1.add(label7, new org.netbeans.lib.awtextra.AbsoluteConstraints(140, 114, -1, -1));

        cmbRuanganTujuan.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cmbRuanganTujuanActionPerformed(evt);
            }
        });
        pnlForm1.add(cmbRuanganTujuan, new org.netbeans.lib.awtextra.AbsoluteConstraints(350, 130, 160, 20));

        cmbRuangan.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cmbRuanganActionPerformed(evt);
            }
        });
        pnlForm1.add(cmbRuangan, new org.netbeans.lib.awtextra.AbsoluteConstraints(120, 130, 170, 20));

        ruanganTujuan.setForeground(new java.awt.Color(255, 255, 51));
        ruanganTujuan.setBorder(null);
        ruanganTujuan.setOpaque(false);
        pnlForm1.add(ruanganTujuan, new org.netbeans.lib.awtextra.AbsoluteConstraints(520, 130, 40, 20));

        ruangan.setForeground(new java.awt.Color(255, 255, 51));
        ruangan.setBorder(null);
        ruangan.setOpaque(false);
        pnlForm1.add(ruangan, new org.netbeans.lib.awtextra.AbsoluteConstraints(300, 130, 40, 20));

        kdBarang.setForeground(new java.awt.Color(255, 255, 51));
        kdBarang.setBorder(null);
        kdBarang.setOpaque(false);
        pnlForm1.add(kdBarang, new org.netbeans.lib.awtextra.AbsoluteConstraints(110, 160, 80, -1));

        kdSupplier.setForeground(new java.awt.Color(255, 255, 51));
        kdSupplier.setBorder(null);
        kdSupplier.setOpaque(false);
        pnlForm1.add(kdSupplier, new org.netbeans.lib.awtextra.AbsoluteConstraints(380, 170, 90, -1));

        cmbNamaBarang.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cmbNamaBarangActionPerformed(evt);
            }
        });
        pnlForm1.add(cmbNamaBarang, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 190, 160, -1));

        label9.setText("User");
        pnlForm1.add(label9, new org.netbeans.lib.awtextra.AbsoluteConstraints(600, 114, 70, -1));

        cmbUser.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cmbUserActionPerformed(evt);
            }
        });
        pnlForm1.add(cmbUser, new org.netbeans.lib.awtextra.AbsoluteConstraints(570, 130, 150, -1));

        kdUser.setForeground(new java.awt.Color(255, 255, 51));
        kdUser.setBorder(null);
        kdUser.setFocusable(false);
        kdUser.setOpaque(false);
        pnlForm1.add(kdUser, new org.netbeans.lib.awtextra.AbsoluteConstraints(740, 130, 70, -1));

        getContentPane().add(pnlForm1, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 890, 510));

        java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
        setBounds((screenSize.width-892)/2, (screenSize.height-512)/2, 892, 512);
    }// </editor-fold>//GEN-END:initComponents

private void txtJumlahActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtJumlahActionPerformed
// TODO add your handling code here:
    
}//GEN-LAST:event_txtJumlahActionPerformed


private void formWindowClosing(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosing
// TODO add your handling code here:
    System.exit(1);
}//GEN-LAST:event_formWindowClosing

private void btnTutupActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnTutupActionPerformed
    dispose();
}//GEN-LAST:event_btnTutupActionPerformed

private void btnSimpanActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSimpanActionPerformed
// TODO add your handling code here:
     Connection c = KoneksiDatabase.getKoneksi();
    if (tblPemesananSupplier.getRowCount() == 0) {
        JOptionPane.showMessageDialog(null, "Data Masih Kosong..!!", "Warning", JOptionPane.INFORMATION_MESSAGE);
    } else {
        try {
            String noOrder = txtNoOrder.getText();
            String kdRuang = ruangan.getText();
            SimpleDateFormat Format = new SimpleDateFormat("yyyy-MM-dd");
            String tanggal = Format.format(txtTanggalOrder.getDate());
            String KdRuangTujuan = ruanganTujuan.getText();
            String User= kdUser.getText();
            
            
            
            
           
            Statement stm = c.createStatement();
           String sql = "insert into strukorder values('" + noOrder + "','" + tanggal + "','" + kdRuang + "','" + KdRuangTujuan + "','" + User + "')";
          

         stm.executeUpdate(sql);
           

            for (int i = 0; i < tblPemesananSupplier.getRowCount(); i++) {

                    String barang = (String) tblPemesananSupplier.getValueAt(i, 0);
                    String jmlOrder= (String) tblPemesananSupplier.getValueAt(i, 2);
                    

                 String sql1 = "insert into detailorderruangan values('" + noOrder + "','" + barang + "','" + jmlOrder + "')";

                  stm.executeUpdate(sql1);

                }
            
            JOptionPane.showMessageDialog(this, "Data Berhasil Disimpan");
            txtNoOrder.setText("");
            txtJumlah.setText("");
            kdBarang.setText("");
            ruangan.setText("");
            ruanganTujuan.setText("");
            kdUser.setText("");
            txtTotal.setText("");
            cmbNamaBarang.setSelectedItem("");
            cmbUser.setSelectedItem("");
            cmbRuanganTujuan.setSelectedItem("");
            cmbRuangan.setSelectedItem("");
            
            
            
        } catch (SQLException e) {
            System.out.println("Error : " + e);
            JOptionPane.showConfirmDialog(null, "Penginputan Error..!!", ".:Information", JOptionPane.OK_OPTION);
        }
    }

}//GEN-LAST:event_btnSimpanActionPerformed

private void cmbRuanganActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cmbRuanganActionPerformed
// TODO add your handling code here:
    try{
         Statement stm = koneksi.createStatement();
         ResultSet rs = stm.executeQuery("select KdRuangan from ruangan where NamaRuangan= '"+cmbRuangan.getSelectedItem().toString()+"'");
         rs.beforeFirst();
         while(rs.next()){
             ruangan.setText(rs.getString(1).trim());
         }
         rs.close();
         }
         catch(SQLException ex)
         {
             System.out.println("Error : "+ex);
             }
}//GEN-LAST:event_cmbRuanganActionPerformed

private void cmbRuanganTujuanActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cmbRuanganTujuanActionPerformed
// TODO add your handling code here:
    try{
         Statement stm = koneksi.createStatement();
         ResultSet rs = stm.executeQuery("select KdRuangan from ruangan where NamaRuangan= '"+cmbRuanganTujuan.getSelectedItem().toString()+"'");
         rs.beforeFirst();
         while(rs.next()){
             ruanganTujuan.setText(rs.getString(1).trim());
         }
         rs.close();
         }
         catch(SQLException ex)
         {
             System.out.println("Error : "+ex);
             }
}//GEN-LAST:event_cmbRuanganTujuanActionPerformed

private void cmbNamaSupplierActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cmbNamaSupplierActionPerformed
// TODO add your handling code here:
    try{
         Statement stm = koneksi.createStatement();
         ResultSet rs = stm.executeQuery("select KdSupplier from supplier where NamaSupplier= '"+cmbNamaSupplier.getSelectedItem().toString()+"'");
         rs.beforeFirst();
         while(rs.next()){
             kdSupplier.setText(rs.getString(1).trim());
         }
         rs.close();
         }
         catch(SQLException ex)
         {
             System.out.println("Error : "+ex);
             }
    
}//GEN-LAST:event_cmbNamaSupplierActionPerformed

private void btnTambahActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnTambahActionPerformed
    
    String []a=new String[3];
        a[0]=kdBarang.getText();
        a[1]=cmbNamaBarang.getSelectedItem().toString();
        a[2]=txtJumlah.getText();
        
     model.addRow(a);  
     hitung_total();
}//GEN-LAST:event_btnTambahActionPerformed

private void cmbNamaBarangActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cmbNamaBarangActionPerformed
// TODO add your handling code here:
    try{
         Statement stm = koneksi.createStatement();
         ResultSet rs = stm.executeQuery("select KdBarang from obat where NamaBarang= '"+cmbNamaBarang.getSelectedItem().toString()+"'");
         rs.beforeFirst();
         while(rs.next()){
             kdBarang.setText(rs.getString(1).trim());
         }
         rs.close();
         }
         catch(SQLException ex)
         {
             System.out.println("Error : "+ex);
             }
}//GEN-LAST:event_cmbNamaBarangActionPerformed

private void btnHapusActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnHapusActionPerformed
// TODO add your handling code here:
    int row=tblPemesananSupplier.getSelectedRow();
    model.removeRow(row);  
}//GEN-LAST:event_btnHapusActionPerformed

private void cmbUserActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cmbUserActionPerformed
// TODO add your handling code here:
    try{
         Statement stm = koneksi.createStatement();
         ResultSet rs = stm.executeQuery("select IdPegawai from pegawai where Nama= '"+cmbUser.getSelectedItem().toString()+"'");
         rs.beforeFirst();
         while(rs.next()){
             kdUser.setText(rs.getString(1).trim());
         }
         rs.close();
         }
         catch(SQLException ex)
         {
             System.out.println("Error : "+ex);
             }
}//GEN-LAST:event_cmbUserActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private SIMRS.Apotek.widget.button2 btnBatal;
    private SIMRS.Apotek.widget.button2 btnHapus;
    private SIMRS.Apotek.widget.button2 btnSimpan;
    private SIMRS.Apotek.widget.button2 btnTambah;
    private SIMRS.Apotek.widget.button2 btnTutup;
    private javax.swing.JComboBox cmbNamaBarang;
    private javax.swing.JComboBox cmbNamaSupplier;
    private javax.swing.JComboBox cmbRuangan;
    private javax.swing.JComboBox cmbRuanganTujuan;
    private javax.swing.JComboBox cmbUser;
    private javax.swing.JTextField kdBarang;
    private javax.swing.JTextField kdSupplier;
    private javax.swing.JTextField kdUser;
    private SIMRS.Apotek.widget.Label label1;
    private SIMRS.Apotek.widget.Label label13;
    private SIMRS.Apotek.widget.Label label2;
    private SIMRS.Apotek.widget.Label label3;
    private SIMRS.Apotek.widget.Label label4;
    private SIMRS.Apotek.widget.Label label5;
    private SIMRS.Apotek.widget.Label label6;
    private SIMRS.Apotek.widget.Label label7;
    private SIMRS.Apotek.widget.Label label8;
    private SIMRS.Apotek.widget.Label label9;
    private SIMRS.Apotek.widget.PnlForm pnlForm1;
    private javax.swing.JTextField ruangan;
    private javax.swing.JTextField ruanganTujuan;
    private SIMRS.Apotek.widget.ScrollPane scrollPane1;
    private SIMRS.Apotek.widget.Table tblPemesananSupplier;
    private SIMRS.Apotek.widget.TextBox txtJumlah;
    private SIMRS.Apotek.widget.TextBox txtNoOrder;
    private com.toedter.calendar.JDateChooser txtTanggalOrder;
    private SIMRS.Apotek.widget.TextBox txtTotal;
    // End of variables declaration//GEN-END:variables

   
public void isiText(String noOrder, String ruang, String ruangTujuan, String idUser, String nmBarang, String jmlh, Date a){
  txtNoOrder.setText(noOrder);
  cmbRuangan.setSelectedItem(ruang);
  cmbRuanganTujuan.setSelectedItem(ruangTujuan);
  cmbUser.setSelectedItem(idUser);
  cmbNamaBarang.setSelectedItem(nmBarang);
  txtJumlah.setText(jmlh);
  txtTanggalOrder.setDate(a);
//  txtTotal.setText(tot);
  
}

private void hitung_total()
    {
       
        int jml, xtot, total;
      
        jml = Integer.parseInt(txtJumlah.getText());
      //  xtot = jml + jml;
       String xjml = Integer.toString(jml);
        txtTotal.setText(xjml);
        tblPemesananSupplier.getCellRenderer(jml, 3);
        
    }

}
